<extend name="Layout/page_detail" />
<block name="content">
	{:W('PageHeader/simple',array('name'=>'账户设置'))}
	<div class="space-8"></div>
	<if condition="$auth['write']">
		<div class="operate panel panel-default">
			<div class="panel-body">
				<div class="pull-left">
					<a class="btn btn-sm btn-primary" href="{:U('index')}">返回</a>
				</div>
				<div class="pull-right">
					<a class="btn btn-sm btn-primary" onclick="add()">新建</a>
				</div>
			</div>
		</div>
	</if>
	<div class="ul_table">
		<ul>
			<li class="thead">
				<span class="col-10 ">账户名称</span>
				<span class="col-8 ">日期</span>
				<span class="col-20 ">开户银行</span>
				<span class="col-20 ">帐号</span>
				<span class="col-8 text-center">初始金额</span>
				<span class="col-8 text-center">账户余额</span>
				<div class="pull-right">
					<span class="col-8 text-center">操作</span>
				</div>
				<span class="auto autocut">备注 </span>
			</li>
			<empty name="list">
				<li class="no-data">
					没找到数据
				</li>
				<else/>
				<foreach name="list" item="vo">
					<li class="tbody">
						<span class="col-10 "><a href="{:U('edit_account','account_id='.$vo['id'])}">{$vo.name}</a></span>
						<span class="col-8">{$vo.create_time|to_date='Y-m-d'}</span>
						<span class="col-20 ">{$vo.bank}</span>
						<span class="col-20 ">{$vo.no}</span>
						<span class="col-8 text-center">{$vo.init}</span>
						<span class="col-8 text-center">{$vo.balance}</span>
						<div class="pull-right">
							<span class="col-8 text-center"><a onclick="del({$vo.id});">删除</a></span>
						</div>
						<span class="auto autocut">{$vo.remark} </span>

					</li>
				</foreach>
				<div class="pagination">
					{$page}
				</div>
			</empty>
		</ul>
	</div>

</block>
<block name="js">
	<script type="text/javascript">
		$(document).ready(function() {
			set_return_url(location.href,1);
		});

		function add() {
			window.open("{:U('add_account')}", "_self");
		}

		function del(id) {
			ui_confirm('确定要删除吗?', function() {
				window.open(fix_url("{:U('del_account')}?account_id=" + id), "_self");
			});
		};

	</script>
</block>